Rail3D*


 

Hi Lat Bug


You may be aware of the Rail3D “High-Latitude Problem”. This is where, if you have a layout with high x or y coordinates (ie in the 100,000s or higher) the motion of the trains becomes jittery. The problem is demonstrated in the first part of the video below. This problem has existed for a very long time, but since I suspected the cause was the limits of the floating point precision used, I knew the fix would have wide implications over a lot of the code. So for a long time I resisted tackling the problem.

Recently I decided to look at the issue, and try fixing it. My first attempt was to replace the floating point variables with a custom type – which took a lot of doing across an awful lot of the code. It worked, but introduced unacceptable speed issues.

Last week, I decided on a simpler approach, and over the last few days have been working to implement this. Again this took a lot of recoding across a lot of the Rail3D source code, but I’m pleased to say it is working, and doesn’t slow things down.

This video shows the same simple test layout with the problem (before the fix) and afterwards with the new code.

 

 

MRG 07/12/2015 13:13:47